//
//  DetailCollectionCell.m
//  HappyBaby
//
//  Created by lanou on 15/11/25.
//  Copyright © 2015年 华哥. All rights reserved.
//

#import "DetailCollectionCell.h"
#import "UIImageView+WebCache.h"
@implementation DetailCollectionCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // 初始化时加载collectionViewCell Xib
        NSArray *arrayOfViews = [[NSBundle mainBundle] loadNibNamed:@"CollectionCell" owner:self options:nil];
        // 如果路径不存在 返回return nil
        if (arrayOfViews.count < 1) {
            return nil;
        }
        // 如果xib中的View不属于UICollectionViewCell类。return nil
        if (![[arrayOfViews objectAtIndex:0] isKindOfClass:[UICollectionViewCell class]]) {
            return nil;
        }
        // 加载nib
        self = [arrayOfViews objectAtIndex:0];
    }
    return self;
}

- (void)setGuessLikeModel:(GuessLikeModel *)guessLikeModel
{
    _guessLikeModel = guessLikeModel;
    NSURL *url = [NSURL URLWithString:guessLikeModel.post_cover_image];
    [self.iconImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"placeHoldImage5"]];
    self.titleLable.text = guessLikeModel.post_title;
    
    
}

@end
